/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GiaoDien;

import KetNoiSQL.KetNoiSQL;
import QuanLyDatHang.DanhSachDatHang;
import QuanLyDonViTinh.DanhSachDonViTinh;
import QuanLyHoaDon.DanhSachHoaDon;
import QuanLyKhachHang.DanhSachKhachHang;
import QuanLyLoaiThuoc.DanhSachLoaiThuoc;
import QuanLyNguoiDung.DanhSachNguoiDung;
import QuanLyNhaCungCap.DanhSachNhaCungCap;
import QuanLyNhaCungCap.DanhSachNhaCungCap;
import QuanLyThuoc.DanhSachThuoc;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import javax.swing.Timer;

/**
 *
 * @author PhuongNga
 */
public class GiaoDienChinh extends javax.swing.JFrame {

    /**
     * Creates new form GiaoDienChinh
     */
    public GiaoDienChinh() {
        initComponents();
        Timer dongho = new Timer(1000, new ActionListener() {
             public void actionPerformed(ActionEvent e) {
               Calendar lich = Calendar.getInstance();
               int gio = lich.get(Calendar.HOUR);
               int phut = lich.get(Calendar.MINUTE);
               int giay=lich.get(Calendar.SECOND);
               txtGio.setText(" "+gio+ " : " +phut+ " : " +giay);
             }
         });
        dongho.start();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        btQLNhaCungCap = new javax.swing.JButton();
        tbpNoidung = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        btQLLoaiThuoc = new javax.swing.JButton();
        btDVT = new javax.swing.JButton();
        btQLThuoc = new javax.swing.JButton();
        btQLNguoiDung = new javax.swing.JButton();
        btQLKhacHang = new javax.swing.JButton();
        btQLDatHang = new javax.swing.JButton();
        btQLHoaDon = new javax.swing.JButton();
        jPanel2 = new javax.swing.JPanel();
        txtGio = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        btQLNhaCungCap.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLNhaCungCap.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLNhaCungCap.setText("Quản Lý Nhà Cung Cấp         ");
        btQLNhaCungCap.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLNhaCungCapActionPerformed(evt);
            }
        });

        tbpNoidung.setBackground(new java.awt.Color(255, 255, 255));
        tbpNoidung.setMinimumSize(new java.awt.Dimension(38, 28));
        tbpNoidung.setName(""); // NOI18N

        jPanel1.setBackground(new java.awt.Color(204, 204, 255));
        jPanel1.setFocusCycleRoot(true);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Flag_of_WHO.svg_.png"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 864, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 517, Short.MAX_VALUE)
        );

        tbpNoidung.addTab("Nội dung", jPanel1);

        jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); // NOI18N
        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/baner1.jpg"))); // NOI18N

        btQLLoaiThuoc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLLoaiThuoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLLoaiThuoc.setText("Quản Lý Loại Thuốc               ");
        btQLLoaiThuoc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLLoaiThuocActionPerformed(evt);
            }
        });

        btDVT.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btDVT.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btDVT.setText("Quản Lý Đơn Vị Tính             ");
        btDVT.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btDVTActionPerformed(evt);
            }
        });

        btQLThuoc.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLThuoc.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLThuoc.setText("Quản Lý Thuốc                      ");
        btQLThuoc.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLThuocActionPerformed(evt);
            }
        });

        btQLNguoiDung.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLNguoiDung.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLNguoiDung.setText("Quản Lý Người Dùng           ");
        btQLNguoiDung.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLNguoiDungActionPerformed(evt);
            }
        });

        btQLKhacHang.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLKhacHang.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLKhacHang.setText("Quản Lý Khác Hàng              ");
        btQLKhacHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLKhacHangActionPerformed(evt);
            }
        });

        btQLDatHang.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLDatHang.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLDatHang.setText("Quản Lý Đặt Hàng                ");
        btQLDatHang.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLDatHangActionPerformed(evt);
            }
        });

        btQLHoaDon.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        btQLHoaDon.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Anh/Add-button_32x32.png"))); // NOI18N
        btQLHoaDon.setText("Quản Lý Hóa Đơn                 ");
        btQLHoaDon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btQLHoaDonActionPerformed(evt);
            }
        });

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "BÂY GIỜ LÀ:", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, new java.awt.Color(255, 0, 0)));

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(txtGio)
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(txtGio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(27, 27, 27)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btQLNhaCungCap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btQLLoaiThuoc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btDVT, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btQLThuoc, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btQLNguoiDung, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btQLKhacHang, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btQLDatHang, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btQLHoaDon, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(tbpNoidung, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(132, 132, 132)
                        .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 985, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(btQLNhaCungCap, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btQLLoaiThuoc, javax.swing.GroupLayout.PREFERRED_SIZE, 43, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btDVT, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(21, 21, 21)
                        .addComponent(btQLThuoc, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btQLKhacHang, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btQLDatHang, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btQLHoaDon, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btQLNguoiDung, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 64, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(tbpNoidung, javax.swing.GroupLayout.PREFERRED_SIZE, 545, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(114, Short.MAX_VALUE))
        );

        tbpNoidung.getAccessibleContext().setAccessibleName("Nội dung");

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btQLNhaCungCapActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLNhaCungCapActionPerformed

        DanhSachNhaCungCap dsncc = new DanhSachNhaCungCap();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachNhaCungCap", dsncc);
    }//GEN-LAST:event_btQLNhaCungCapActionPerformed

    private void btQLLoaiThuocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLLoaiThuocActionPerformed
        // TODO add your handling code here:
        DanhSachLoaiThuoc dslt = new DanhSachLoaiThuoc();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachLoaiThuoc", dslt);
    }//GEN-LAST:event_btQLLoaiThuocActionPerformed

    private void btDVTActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btDVTActionPerformed
        // TODO add your handling code here:
        DanhSachDonViTinh dsdvt = new DanhSachDonViTinh();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachDonViTinh", dsdvt);
    }//GEN-LAST:event_btDVTActionPerformed

    private void btQLThuocActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLThuocActionPerformed
        DanhSachThuoc dst = new DanhSachThuoc();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachThuoc", dst);
    }//GEN-LAST:event_btQLThuocActionPerformed

    private void btQLKhacHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLKhacHangActionPerformed
        // TODO add your handling code here:
        DanhSachKhachHang dskh = new DanhSachKhachHang();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachKhachHang", dskh);
    }//GEN-LAST:event_btQLKhacHangActionPerformed

    private void btQLNguoiDungActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLNguoiDungActionPerformed
        // TODO add your handling code here:
        DanhSachNguoiDung dsnd = new DanhSachNguoiDung();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachKhachHang", dsnd);
    }//GEN-LAST:event_btQLNguoiDungActionPerformed

    private void btQLDatHangActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLDatHangActionPerformed
        // TODO add your handling code here:
        DanhSachDatHang dh = new DanhSachDatHang();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachDatHang", dh);
    }//GEN-LAST:event_btQLDatHangActionPerformed

    private void btQLHoaDonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btQLHoaDonActionPerformed
        // TODO add your handling code here:
        DanhSachHoaDon hd = new DanhSachHoaDon();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachHoaDon",hd);
    }//GEN-LAST:event_btQLHoaDonActionPerformed
    //tạo đóng from thêm thuốc

    public void dongThemThuoc() {
        DanhSachThuoc dst = new DanhSachThuoc();
        tbpNoidung.removeAll();
        tbpNoidung.add("DanhSachThuoc", dst);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        KetNoiSQL kn = new KetNoiSQL();
        GiaoDienChinh gd = new GiaoDienChinh();
        gd.setVisible(true);
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btDVT;
    private javax.swing.JButton btQLDatHang;
    private javax.swing.JButton btQLHoaDon;
    private javax.swing.JButton btQLKhacHang;
    private javax.swing.JButton btQLLoaiThuoc;
    private javax.swing.JButton btQLNguoiDung;
    private javax.swing.JButton btQLNhaCungCap;
    private javax.swing.JButton btQLThuoc;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JTabbedPane tbpNoidung;
    private javax.swing.JTextField txtGio;
    // End of variables declaration//GEN-END:variables
}
